{extend name=".././view/create.html" /}
{block name="jscss"}
{load href="__MAYI__/js/Convert_Pinyin.js" /}
{/block}
{block name="form"}
<form class="layui-form layui-form-pane" lay-filter="myform">
	<div class="layui-form-item">
		<label for="xingming" class="layui-form-label">
			<span class="x-red">*</span>用户姓名
		</label>
		<div class="layui-input-block">
			<input type="text" id="xingming" name="xingming" lay-verify="required" autocomplete="off" class="layui-input " value="{$list.data.xingming|default=''}" placeholder="中文2-25个字符" onBlur="convertName()">
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-inline">
			<label class="layui-form-label">
				<span class="x-red">*</span>姓名拼音
			</label>
			<div class="layui-input-inline" style="width: 35%; margin-right: 20px">
				<input type="text" id="quanpin" name="quanpin" placeholder="全拼" autocomplete="off" class="layui-input" lay-verify="required" value="{$list.data.quanpin|default=''}">
			</div>
			<div class="layui-input-inline" style="width: 25%;">
				<input type="text" id="shoupin" name="shoupin" placeholder="简拼" autocomplete="off" class="layui-input" lay-verify="required" value="{$list.data.shoupin|default=''}">
			</div>
		</div>
	</div>
	<div class="layui-form-item">
		<label for="username" class="layui-form-label">
			<span class="x-red">*</span>帐号
		</label>
		<div class="layui-input-block">
			<input type="text" id="username" name="username" lay-verify="required" autocomplete="off" class="layui-input" value="{$list.data.username|default=''}" placeholder="由字母、数字-_组成 6-12个字符">
		</div>
	</div>
	<div class="layui-form-item">
		<label for="shengri" class="layui-form-label">
			<span class="x-red">*</span>出生日期
		</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="shengri" name="shengri" lay-verify="required" autocomplete="off" value="{$list.data.shengri|default=''}" placeholder="日期格式">
		</div>
	</div>
	<div class="layui-form-item" pane>
		<label for="sex" class="layui-form-label"><span class="x-red">*</span>性别</label>
		<div class="layui-input-block">
			<input type="radio" name="sex" value="1" title="男" {present name="$list.data.sex" } {$list.data.sex} {eq name="$list.data.sex" value="男" } checked {/eq} {/present}> <input type="radio" name="sex" value="0" title="女" {present name="$list.data.sex" } {eq name="list.data.sex" value="女" } checked {/eq} {/present} {notpresent name="$list.data.sex" } checked {/notpresent}> </div> </div> <div class="layui-form-item">
			<label for="phone" class="layui-form-label">
				电话号码
			</label>
			<div class="layui-input-block">
				<input type="input" id="phone" name="phone" lay-verify="" autocomplete="off" class="layui-input" value="{$list.data.phone|default=''}" placeholder="数字">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="zhicheng_id" class="layui-form-label">职称</label>
			<div class="layui-input-block">
				<select name="zhicheng_id" id="zhicheng_id" lay-verify="required">
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label for="xueli_id" class="layui-form-label">学历</label>
			<div class="layui-input-block">
				<select name="xueli_id" id="xueli_id" lay-verify="required">
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label for="biye" class="layui-form-label">
				毕业院校
			</label>
			<div class="layui-input-block">
				<input type="text" id="biye" name="biye" autocomplete="off" class="layui-input " value="{$list.data.biye|default=''}" placeholder="中文2-25个字符">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="zhuanye" class="layui-form-label">
				专业
			</label>
			<div class="layui-input-block">
				<input type="text" id="zhuanye" name="zhuanye" autocomplete="off" class="layui-input " value="{$list.data.zhuanye|default=''}" placeholder="中文2-25个字符">
			</div>
		</div>
		<div class="layui-form-item">
			<label for="worktime" class="layui-form-label">
				入职时间
			</label>
			<div class="layui-input-block">
				<input type="input" id="worktime" name="worktime" class="layui-input" value="{$list.data.worktime|default=''}" placeholder="入职时间" autocomplete="off">
			</div>
		</div>
		<div class="layui-form-item" style="text-align: right;">
			<button class="layui-btn" lay-filter="mysubmit" lay-submit="">
				{$list.set.butname}
			</button>
		</div>
</form>
{/block}
{block name="myjs"}
<script>
layui.use(['laydate', 'createInput'], function() {
	var laydate = layui.laydate,
		cInput = layui.createInput;

	cInput.categorySelect('zhicheng_id', 106, "{$list.data.zhicheng_id|default=''}");
	cInput.categorySelect('xueli_id', 105, "{$list.data.xueli_id|default=''}");

	//开始时间
	laydate.render({
		elem: '#shengri',
		type: 'datetime',
		trigger: 'click' //采用click弹出
			,
		format: 'yyyy-M-d' //可任意组合
	});
	//参加工作时间
	laydate.render({
		elem: '#worktime' //指定元素
			,
		trigger: 'click' //采用click弹出
	});
});

function convertName() {
	var xingming = $('#xingming').val();
	//获取全写拼音（调用js中方法）
	var quanpin = pinyin.getFullChars(xingming);
	//获取简写拼音（调用js中方法）
	var shoupin = pinyin.getCamelChars(xingming);
	//给两个文本框赋值
	$('#quanpin').val(quanpin);
	$('#shoupin').val(shoupin);
}

</script>
{/block}
